﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage/PBOAMasterPage.master"
    AutoEventWireup="true" CodeFile="Power.aspx.cs" Inherits="SystemManagePage_Power" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <link href="../CSS/SystemManagePages.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript">
        //全选，和反选
        function AllCheck(selectID) {
            var checkID = "ContentPlaceHolder1_" + selectID; //生成编号
            var checkListID = "ContentPlaceHolder1_" + "list" + selectID;
            //获得当前checkb的状态
            var checkbox = document.getElementsByTagName("input");
            for (var i = 0; i < checkbox.length; i++) {
                if (checkbox[i].id == checkID) {
                    var Ischeck = checkbox[i].checked;
                }
            }
            //在界面输出以后。checkboxList 就会变成table 中有很多checkbox的形式
            //所以要找到想要的table
            var table = document.getElementsByTagName("table");
            for (var i = 0; i < table.length; i++) {
                if (table[i].id == checkListID) {
                    //table 找到以后就可以找table下面的checkbox了
                    var checkboxList = table[i].getElementsByTagName("input");
                }
            }
            //遍历判断找到的结果
            for (var i = 0; i < checkboxList.length; i++) {
                if (checkboxList[i].id == checkListID + "_" + i && checkboxList[i].type == "checkbox") {
                    checkboxList[i].checked = Ischeck;
                }
            }
        }
        //根据如果子项选择，就选择父项
        function selectCheck(checkListId) {
            var input = document.getElementsByTagName("input");
            var index = checkListId.id.lastIndexOf("_list")+5;//得到处理字符串用的索引
            var checkid = "ContentPlaceHolder1_"  +checkListId.id.substring(index)//得到checkbox的 ID
            for (var i = 0; i < input.length; i++) {
                if (input[i].id == checkid && input[i].type == "checkbox") {
                    input[i].checked = true;
                }
            }
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <div id="power">
        <uc:Navigator Text="角色分配" runat="server" />
        <table>
            <tr>
                <td>
                    当前修改的角色：
                </td>
                <td>
                    <asp:Label ID="Labelrole" runat="server" Text="Label" Font-Bold="True"></asp:Label>
                </td>
            </tr>
        </table>
        <div id="middle_power" runat="server">
        </div>
        <div id="bottom_power">
            <asp:ImageButton ID="ImageButtonSave" runat="server" CssClass="btn_power" 
                Height="20px" ImageUrl="~/Images/file/savecon.gif" 
                onclick="ImageButtonSave_Click" />
            <asp:ImageButton ID="ImageButtonCancel" runat="server" CssClass="btn_power" 
                ImageUrl="~/Images/file/cancel.gif" />
        </div>
    </div>
</asp:Content>
